<template>
  <FormItem label="左外边距">
    <InputNumber :value="value | newValue" placeholder="请输入左外边距" @on-change="v=>{changeValue(v)}" />
  </FormItem>
</template>

<script>
export default {
  props: {
    value: {
      default: ''
    }
  },

  mounted(){
  },
  data () {
    return {};
  },
  methods: {
    changeValue (value) {
      this.$emit('updateValue', {
        value: value + 'px',
        name: 'marginLeft'
      });
    }
  },
  filters: {
    newValue(value){
      return value === '' ? 0 : parseInt(value)
    }
  }
};
</script>
